﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using TTGame;

/*
 * SynTransformNode
 *
 * 和指定transform的位移和转向保持一致。
 *
 * 依赖：
 *
 * ！不写重复代码！
 * @author TTun
 * @date 8/29/2017 9:45:47 AM
 */
namespace TTGameEngine {

public class SynTransformNode : MonoBehaviour {
    public Transform targetTF;
    Transform thisTF;

    void Awake() {
        thisTF = transform;
        SynTransformInfo();
    }

    // Update is called once per frame
    void Update() {
        SynTransformInfo();
    }

    void SynTransformInfo() {
        if (targetTF != null) {
            thisTF.position = targetTF.position;
            thisTF.rotation = targetTF.rotation;
        }
    }
}

}
